import json

from google.appengine.ext import db


class Libraries(db.Model):
    json = db.TextProperty(required=True)

    @staticmethod
    def update(libraries):
        db.delete(Libraries.all(keys_only=True))
        db.put(Libraries(json=json.dumps(libraries)))
